Skip to content

fix(metadata-protocol): revertCommit reports a restored non-object item whose registry write-through faults - #33979

Merged
objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/area-E1-33851
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/area-E1-33851

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #33851

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:撤销提交(revertCommit)现在对所有类型如实上报两类故障。第一类是恢复视图、权限、对象扩展等条目时,写入运行时注册表出错;这时该条目列入 failed[],写明「行已恢复到版本 N」。第二类是撤销删除条目后注册表修复(heal)中途停止;这时写明「行已从 sys_metadata 移除,注册表可能仍在提供被删的行」。两类都带出错原因和 code,success 为 false,和对象条目的处理一致。
  • 为什么改:以前这些故障只记日志,撤销照样报 success:true,但进程实际还在使用旧内容,违反 revertCommit 自己的契约「success 即进程已生效」(ADR-0067 D3)。
  • 风险与回滚:只有 revertCommit 读这两个新返回值。保存、发布、删除等其他调用方都忽略它们,同样的故障下仍答成功,日志也不变(有对照测试,另有消融证明对照测试能变红)。回滚即 revert 本 PR。
  • 先看:protocol-registry-hydration.ts 中 applyRegistryWriteThrough 的两个 catch 和 restoreArtifactRegistryView 的外层 catch、剩余行循环;protocol-package-commits.ts 的 revertCommit 两个分支;protocol.ts 中两个转发方法的类型。
  • 两分钟验证:pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol.revert-commit-honest-outcome.test.ts,预期 31 个用例全绿(§3 共 12 个,§4 共 9 个)。
  • 需要你做的:无,席位落地。metadata-protocol: revertCommit discards its registry write-through and projector results, so a revert answers success for an item the process never applied #33563 那条变更说明里的一句旧话,在单独的纯文本 PR 中更正。

What changes

applyRegistryWriteThrough has three branches. The object branch has answered the registry's refusal since #33805. The two non-object branches caught their faults and logged them at warn. The first is the overlay hydration, which every type except object and object_extension takes. The second is the object_extension registration. The registry heal that a removal runs (restoreArtifactRegistryView) logged its stop at error and returned nothing.

  • protocol-registry-hydration.ts, write-through. The request has its own exported type, RegistryWriteThroughRequest, with one new optional field, answerFaults. When it is true, a non-object branch that throws still logs the same warn line, and then returns the fault in the ObjectRegistryRefusal shape ({ error }). When it is unset, the answer is undefined, as before.
  • protocol-registry-hydration.ts, heal. restoreArtifactRegistryView now returns a RegistryHealStop ({ error }) in two cases. The first is when its outer catch stopped the walk; the error line it logs is unchanged. The second is when a row still stored under another package, which the heal registers again (with answerFaults: true), is refused or faults; every remaining row is still tried. Otherwise it returns undefined, and that includes the designed outcomes: a refused baseline read that retires the entry, and a degraded read that keeps it.
  • protocol-package-commits.ts, revertCommit. The restore limb sets answerFaults: true. The soft-remove limb reads the heal's stop, but only where a row was actually removed; with no row removed, the heal is a self-heal and stays logged. Both feed the existing notApplied / settle path, so the item lands in failed[] with the row state, the reason and its code. The revert's own commit still records the row change. rollbackToPackageCommit carries the item through its existing per-item channel.
  • protocol.ts, two private forwarders. The restoreArtifactRegistryView forwarder now returns Promise of RegistryHealStop | undefined (ProtocolHost derives its type from it). The applyRegistryWriteThrough forwarder's parameter is now RegistryWriteThroughRequest, in place of its inline copy. The revertCommit docblock sentence that said a non-object write-through fault "is not seen here" now says that every type, and a stopped heal, is reported. The .d.ts carries that docblock, so this change takes a patch changeset.
  • Every other caller ignores the new answers. Save and publish (protocol-save.ts, protocol-history-and-publish.ts) do not set answerFaults. They would report any returned refusal as an object's (object-registry-refused), which ablation A4 shows. The delete door, a publish's undo and a peer's convergence await the heal and discard its answer.
  • Changeset: .changeset/33851-revert-non-object-write-through-fault.md (patch). It says that it supersedes the sentence of the metadata-protocol: revertCommit discards its registry write-through and projector results, so a revert answers success for an item the process never applied #33563 note claiming such a fault "is still not seen by the revert". The metadata-protocol: revertCommit discards its registry write-through and projector results, so a revert answers success for an item the process never applied #33563 note itself is unchanged here: its one sentence is corrected in a separate text-only PR (DELIBERATE CORRECTION).

Tests

packages/metadata-protocol/src/protocol.revert-commit-honest-outcome.test.ts, the revert harness, gains two top-level describes. They go there as AGENTS.md requires (ruling record 6583487846).

  • §3 has 12 cases, 4 each for view, permission and object_extension: a clean restore control, which reaches the registry verb as a non-vacuity check; a write-through throw that goes to failed[] with code, "its row was restored to the body of version 1", the reason and success: false; a save control; and a publish control. The two controls hold under the same fault: success: true, no advisories, and the same warn line.
  • §4 has 9 cases, 4 each for view and permission: a clean soft-remove control; a heal stop that goes to failed[] with code, "its row was removed from sys_metadata", "may still serve the removed row", success: false and the heal's error line kept; a delete control (success: true, error line kept); and a save-and-publish control (both success: true, no advisories). The ninth case is an action row still stored under another package that the registry refuses: it goes to failed[]. As a non-vacuity check, the stop is the remaining row's write-through warn, not the heal's outer-catch error.

Premise, measured on the code before each half. On the write-through half (source at 63e47feeca), §3's 3 fault cases were red: each answered success: true. On the heal half (source at 2d23b49dd1), §4's 3 fault cases were red, with 28 cases green.

Ablations (scripts/ablation-replace.mjs, each landed, run, then restored to blob == HEAD with git diff HEAD empty)
Ablation Red Green
A1: the overlay branch does not answer 2 (§3 view, permission fault) 20 of 22
A2: the extension branch does not answer 1 (§3 object_extension fault) 21 of 22
A3: revertCommit does not set answerFaults 3 (every §3 fault case) 19 of 22
A4: the overlay branch answers every caller 4 (view and permission save and publish controls; the save answered an object-registry-refused advisory, "object 'ticket.grid' was published, but the runtime registry refused it") 18 of 22
A5: the extension branch answers every caller 2 (object_extension save and publish controls) 20 of 22
B1: the heal's outer catch does not return its stop 2 (§4 view, permission heal stop: "expected true to be false" on success) 29 of 31
B2: the remaining row's refusal is dropped 1 (§4 remaining-row case) 30 of 31
B3: revertCommit does not read the heal's stop 3 (every §4 fault case) 28 of 31

My first A1 to A3 attempt was a no-op: the replacement was a substring of the anchor, ablation-replace refused it, and no test ran. They were re-run with distinct markers, and the table shows those runs. A1 to A5 were run before §4 existed (22 cases). B1 to B3 were run on all 31 cases.

Acceptance notes

  • Out of scope, left as it is: in the heal, the object owner branch's unregisterObject refusal ("object 'x' was deleted from sys_metadata but stays registered") is still a warn line that answers no stop. It is an object-only path, and the card's ruling covered the outer catch and the remaining rows.

Verification

Readings, local, at head 999b09d
  • One locked run, at 999b09d9c3 with origin/main 68e726d631 merged in (lock VERDICT command-exit 0; queued 6m18s, after a first attempt's queue-timeout exit 99). It ran: the metadata-protocol dependency closure build; typecheck exit 0; test 342 files passed and 9 skipped, 22923 tests passed; the metadata-protocol build; and the objectql suite, 597 of 597 files and 13177 of 13177 tests.
  • The other direct dependents (runtime, cli, service-automation, cloud-connection) were not run locally. CI runs them (Test Core). The only type that moved is on private forwarders; RegistryHealStop and RegistryWriteThroughRequest are not exported from the package entry.
  • pnpm lint: exit 0.
  • dispatch-gates --ran: 73 derived families, each with its exit code recorded. 70 exit 0. 3 are NOT MEASURED, because each needs the whole workspace built: check:dual-build-cjs-loads, check:lean-entry-closure and check:type-check-debt, all exit 3 (PREREQUISITE NOT MET). CI runs them. The body gates (closing-keyword parity, Part-of, changeset no-major, ADR-0087 registration) exit 0.
  • git merge-tree --write-tree --name-only: clean against origin/main 68e726d631, against fix(metadata-protocol, rest)!: the layered read of a name two packages hold refuses as the plain read does, naming the holders as details.candidates (ADR-0150 D3/D5) #33885's head fa7fb66a7c, and against S5's claude/area-E1b-33832 head 9c4f75f36e. No open PR for metadata-protocol: the history diff door compares two package holders' versions of one name as if they were one item's (ADR-0150 D4, after #32905) #33308 was found. No other open PR touches protocol.ts, protocol-registry-hydration.ts, protocol-package-commits.ts or the harness file.
  • Dogfood: not run, because the title has no ! and Clause-② has no (narrowing) arm.

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ

…registry write-through faults

The write-through's non-object branches (the overlay hydration and the
object_extension registration) answer their fault to a caller that asks
(answerFaults); revertCommit asks, so the item lands in failed[] with its
row state named, as an object's refusal does. Save and publish do not ask
and keep their answers.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
…s into their own file

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
…s in the revert harness file

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 15, 2026
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/metadata-protocol, touching 23 documentable anchor(s).

35 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 68e726d631132db46fd63b887f15927ac3b9b5c3.

⛔ 14 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 10 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 68e726d631132db46fd63b887f15927ac3b9b5c3 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from d2abce3f52af5dc2c071e670671c513e45915e80 — the merge of head 999b09d9c3724b90db62df71dfb52afcf73ec569 into base 68e726d631132db46fd63b887f15927ac3b9b5c3, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin d2abce3f52af5dc2c071e670671c513e45915e80 && git checkout d2abce3f52af5dc2c071e670671c513e45915e80
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 68e726d631132db46fd63b887f15927ac3b9b5c3 999b09d9c3724b90db62df71dfb52afcf73ec569 && git checkout -B drift-repro 68e726d631132db46fd63b887f15927ac3b9b5c3 && git merge --no-ff 999b09d9c3724b90db62df71dfb52afcf73ec569

node scripts/docs-audit/affected-docs.mjs --json 68e726d631132db46fd63b887f15927ac3b9b5c3

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 68e726d631132db46fd63b887f15927ac3b9b5c3 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…istry heal stops

The heal answers its stop (its outer catch, keeping the error line, or a
row still stored that the registry refuses); the soft-remove limb reports
it in failed[] with the removed row named. Every other caller ignores it.
The forwarders in protocol.ts name the heal's stop and the write-through's
request type.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
…hange supersedes its sentence

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ

Request: review · PR #33979 · area S4 (E1) · Fixes #33851 · head 999b09d (green; declared final)

Ordinary ACCEPT read per review-checklist.md. No contract face (Clause-②: no, Metadata-protocol: none, no spec or governed path), so no contract record is owed. Report: #33851 comment 6897529448. Body patched by the area to Fixes #33851 after the heal half folded in (area ruling: option A). Companion text-only PR #34017 (DELIBERATE CORRECTION of the 33563 note) lands after this one under the area's self-review.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6

Review claim · head 999b09d · 2026-11-15T16:23Z

review (review-b, areas S2+S4): ordinary ACCEPT read per review-checklist.md; the verdict follows on this PR.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6

Review — PASS

Head-sha: 999b09d9c3724b90db62df71dfb52afcf73ec569
Area: S4 / E1 · Fixes #33851 · ordinary ACCEPT read per review-checklist.md. No contract face: no packages/spec/src, no governed path, and no narrowing arm.

  1. Premise measured. Red before each half: §3's 3 write-through fault cases answered success: true on 63e47feeca, and §4's 3 heal-stop cases did the same on 2d23b49dd1.
    • Ablations A1–A5 and B1–B3 each turn the named cases red and were restored to blob == HEAD.
    • A4 and A5 prove that the save and publish controls would catch a leaked answer.
  2. Mechanism, read on the tree.
    • answerFaults is set in two places only: revertCommit's restore limb, and the heal's remaining-row loop.
    • The heal answers a RegistryHealStop from its outer catch and from its first remaining-row refusal, and its error line is kept.
    • The soft-remove limb reads the stop only when current holds, that is, when a row was actually removed.
    • I listed every caller of restoreArtifactRegistryView in packages/**. Besides revertCommit there are 11: delete-load ×3, publish ×3, batch registration, class-head, packageless migration, hydration ×2. Each one awaits and discards the answer, so delete, publish undo and convergence keep their answers.
    • rollbackToPackageCommit reaches it through host.revertCommit, so the changeset's sentence about rollback holds.
  3. Clause-② no, Metadata-protocol: none, patch: right. RegistryHealStop and RegistryWriteThroughRequest are not re-exported from src/index.ts, and the forwarders that use them are private. What changes is revertCommit answering truthfully under ADR-0067 D3 for every type. fix(metadata-protocol): revertCommit answers only what it achieved, and a revert is revertible #33805 already made that move for objects, so this is not a narrowing. Dogfood is n/a because the PR has no ! and no narrowing arm.
  4. Tests.
    • §3 (12 cases) and §4 (9 cases) are top-level describes in the shared revert harness, as AGENTS.md ruling 6583487846 requires.
    • Each fault case asserts success: false, the failed[0] type, name and code (NOT_OVERRIDABLE), and the row-state text.
    • The controls assert the unchanged warn and error lines.
  5. Changeset. Each sentence matches the diff. The metadata-protocol: revertCommit discards its registry write-through and projector results, so a revert answers success for an item the process never applied #33563 note is untouched here, and its one-sentence correction rides docs(changeset): the revert note says what revertCommit reports for a non-object registry fault #34017 (Part of #33851), which must land after this PR.
  6. Lane line. Claim 6895262027 says "no protocol.ts", but the head edits two private forwarders and one docblock in it. That is allowed under the 14:41Z/14:45Z rule change, as on fix(metadata-protocol, rest)!: the layered read of a name two packages hold refuses as the plain read does, naming the holders as details.candidates (ADR-0150 D3/D5) #33885. Amend the claim to name protocol.ts before ACCEPT.
  7. Overlap. I checked git merge-tree --write-tree myself: clean against origin/main and against fix(metadata-protocol, rest)!: the layered read of a name two packages hold refuses as the plain read does, naming the holders as details.candidates (ADR-0150 D3/D5) #33885's current head e516f353, not only the fa7fb66a7c the body cites.
  8. Out-of-scope finding. The heal's object-owner unregisterObject refusal is still only a warn line. It is listed under Acceptance notes and marked "noted, not filed". The seat decides whether to file it, record it as an accepted deviation, or drop it, and writes that outcome in the ACCEPT.
  9. Check-runs on the head: 36 success, 18 skipped, and one in progress, a re-run of Check Changeset started 16:21Z after the body edit (its earlier run on this head succeeded). Lint & Repo Gates, every Type Check lane, Test Core 1–8/8, Build Core and the Dogfood Regression Gate are all green. Arm once the Check Changeset re-run is green.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ

席位核对

ACCEPT · area S4 (E1) · Head-sha: 999b09d9c3724b90db62df71dfb52afcf73ec569

  • Shape: Fixes #33851. The area patched the body after the heal half folded in, read back identical. Draft. Base main.
  • Premise measured: red before each half on main (§3 and §4). Ablations A1–A5 and B1–B3 are quoted in the report 6897529448.
  • Review: review-b PASS on this head (6897589017), ordinary ACCEPT read. No contract face, so no contract record is owed.
  • Gates: 55 check-runs on this head, 37 success and 18 expected skip, none pending. That includes Lint & Repo Gates, TypeScript Type Check, Test Core 1–8/8, Build Core and the Check Changeset re-run after the body edit. check-governed-merges --pr 33979: NOT governed, 460 lines.
  • Accepted deviations:
  • Out of scope: the heal's object-owner unregisterObject refusal is still only a warn line. → Acceptance notes (object-only, no measured reach beyond the log line, outside the card's ruling). Not filed.
  • Changeset: patch, Clause-②: no, Metadata-protocol: none. Each sentence was checked against the diff by review-b (item 5). The 33563 note is untouched here, and its correction rides docs(changeset): the revert note says what revertCommit reports for a non-object registry fault #34017, which lands after this PR.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ

Landing (landing-operations B) · head 999b09d9

Reading Value
check-runs on head 55: 37 success, 18 expected skip, 0 pending/failed
check-governed-merges --pr 33979 NOT governed, 460 lines

State change: ready + auto-merge (area authorising line). #34017 follows after this merges.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 15, 2026 16:27
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 0bbb211 Nov 15, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-E1-33851 branch November 15, 2026 16:57
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
… non-object registry fault (objectstack-ai#34017)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbNTugWasvhTMrtCZiFGrZYK)_

Part of objectstack-ai#33851

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 改了什么:只改一个文件里的一句话。未发布的变更说明
`.changeset/33563-revert-commit-honest-outcome.md`
中,有一句说「非对象类型的注册表写入故障撤销仍看不到」,改成如实描述 objectstack-ai#33979 落地后的行为。
- 为什么改:objectstack-ai#33979 让撤销提交如实上报这些故障,原句因此变为错误;这条说明尚未发布,会原样进入 CHANGELOG。
- 风险与回滚:纯文本,不改代码。应在 objectstack-ai#33979 之后落地,否则这句话会先于代码生效。回滚即 revert 本 PR。
- 先看:`.changeset/33563-revert-commit-honest-outcome.md` 第 12 行。
- 两分钟验证:`git diff origin/main --
.changeset/33563-revert-commit-honest-outcome.md`,预期只有一行改动。
- 需要你做的:无,席位落地(本更正由区域 ACCEPT 确认)。

## What changes

**DELIBERATE CORRECTION** of the unreleased note
`.changeset/33563-revert-commit-honest-outcome.md` (shipped by objectstack-ai#33805).
One sentence is rewritten, and nothing else in the note changes.

Before:

> A write-through fault the registry helper only logs (every metadata
type other than `object`) is still not seen by the revert.

After:

> The same holds for an item of any other metadata type: a restored item
whose registry write-through throws, and a removed item whose registry
heal stops, so that the registry may still serve the removed row.

"The same holds" continues the note's paragraph above it. That paragraph
says an item whose row was written but whose next step did not land goes
into `failed[]`, not `reverted[]`, and the answer's `success` is
`false`. The corrected sentence describes the code of objectstack-ai#33979, which
makes `revertCommit` report both faults for every type. Without objectstack-ai#33979,
the old sentence is true and the new one is false, so this PR lands
after objectstack-ai#33979.

The correction is in its own text-only PR because rewriting an existing
changeset inside a PR that also changes code needs a same-head contract
review, and objectstack-ai#33979 has no contract face. A text-only correction is
confirmed by the area's ACCEPT.

## Tests

None: a changeset prose change. `git diff --stat origin/main...HEAD`
shows one file changed, with 1 insertion and 1 deletion.

## Verification

- Body gates: closing-keyword parity, Part-of, changeset no-major and
ADR-0087 registration all exit 0.
- Check Changeset is expected to report the edit to a changeset that
exists on the merge base. This body is the declaration of that edit as a
DELIBERATE CORRECTION; the `skip-changeset` label is not applied.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ

Co-authored-by: Claude <noreply@anthropic.com>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…red override as effective (objectstack-ai#34169)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbNTugWasvhTMrtCZiFGrZYK)_

Part of objectstack-ai#32849 (the bare layered read's `effective` exit; the read
naming no member, measured below, stays open on objectstack-ai#32849)

Clause-②: no
Metadata-protocol: none

**objectstack-ai#33885 has merged.** This branch started from `claude/area-E1-32622`.
After objectstack-ai#33885 merged, `origin/main` was merged in (`c9112d29`), so the
diff is now this PR's own four files (+125/−7). The own-diff patch-id
`c0f3f1897e73032813735aa937738d8e0c8780a6` is unchanged.

## 维护者速读

- 改了什么:App 的 `.custom` pair 存了一行声明覆盖附加包 Z 自有成员 `fr-FR`
的邮件模板(`overrides.package: Z`)。objectstack-ai#33815 之后普通裸读已给出覆盖,但不带包的分层读
`?member=fr-FR&layers=true` 的 `effective` 仍是 Z 原版 `zeta fr-FR`、`overlay`
为空;现在它与 `?package=Z` 一致:`code` 是 Z 原版,`overlay` 和 `effective` 是覆盖,信封指向
Z。
- 为什么改:分层读的 `effective` 定义为「普通读会返回的内容」,声明了的覆盖应在每个给出 Z 该成员的出口被服务(ADR-0146
D8 第 2 项、ADR-0150 D4);Studio 编辑器读的正是这个出口。
- 风险与回滚:只在普通裸读已经改址到 Z 的同一情形下生效(复用同一个判定函数);未声明覆盖、声明给 X 的行(仍 409)、X 自己的
`en-US`、待发布草稿层均不变(已钉)。回滚即还原本 PR,存储数据不变。
- 先看:`packages/metadata-protocol/src/protocol-meta-layered-reads.ts` 中
`declaredOverrideAt` 与 `draftPackageId` 两处。
- 两分钟验证:`pnpm --filter @objectstack/objectql exec vitest run
--maxWorkers=2 src/package-scoped-exact-qualifier.test.ts -t 'the bare
layered read serves'`,预期 6 条全绿。
- 需要你做的:无,席位落地。

## What changes

Own files (four):
`packages/metadata-protocol/src/protocol-meta-layered-reads.ts`,
`packages/metadata-protocol/src/protocol-meta-item-face.ts` (one
`export` keyword and one docblock sentence, no behaviour),
`packages/objectql/src/package-scoped-exact-qualifier.test.ts`,
`.changeset/32849-bare-layered-read-declared-override.md`. No
`protocol.ts` edit.

`getMetaItemLayered`, naming no package and judged neither served nor
refused by `servedAddressJudgment`, now asks
`declaredMemberOverrideAddressOf` (the one predicate the plain read uses
since objectstack-ai#33815, exported from the item face for this). When it names the
member's one enabled shipper Z, the read takes Z's address for its
layers, as the plain read does, so `effective` is the override
`?package=Z` serves.

The pending draft layer (`withDraft`, the Studio door) is not moved: it
stays at the address the strict draft read takes
(`strictDraftReadAddress`), because the plain read's strict draft read
is outside the arm too. Re-addressing it would have made the draft layer
`null` where the strict draft read serves the pair's draft (measured: at
`?package=Z` the draft layer is `null`).

| read (both install orders) | before | after |
|:--|:--|:--|
| bare `?member=fr-FR&layers=true`, row declares Z | code `zeta fr-FR`,
overlay null, effective `zeta fr-FR` | code `zeta fr-FR`, overlay `pair
fr-FR`, effective `pair fr-FR`, envelope Z (= `?package=Z`) |
| same, with drafts, a pair draft pending | draft `pair fr-FR draft` |
unchanged (effective as above) |
| `?package=Z&member=fr-FR&layers=true` | effective `pair fr-FR` |
unchanged |
| bare `?member=en-US&layers=true` (X's own) | `suitex en-US` |
unchanged |
| bare, no row / undeclared pair row | effective `zeta fr-FR`, overlay
null | unchanged |
| bare, row declares X (objectstack-ai#32606 shape) | 409 naming X and Z | unchanged |
| door step 1c, `packagelessLayeredReadRefusal` | no refusal | unchanged
|

Nothing refused becomes served or the reverse; no authorable key or
value moves.

## Tests

New top-level describe in the shared real-`SchemaRegistry` harness
`packages/objectql/src/package-scoped-exact-qualifier.test.ts`:
`[objectstack-ai#32849] the bare layered read serves the pair's declared override of
an addition Z's own locale as effective, as ?package=Z does` (6 tests):

- fix pin, both install orders: bare layers equal `?package=Z`'s
(`effective` deep-equals the `?package=Z` document), step 1c refuses
nothing, `effective` equals the plain bare read, X's `en-US` untouched.
- draft pin: the draft layer is the strict draft read's (`pair fr-FR
draft`), `?package=Z` has none.
- CONTROL no override x2 (no row / undeclared pair row): Z's own, no
overlay.
- CONTROL row declares X: 409 `RESOURCE_CONFLICT` naming X and Z.

BASE measured on `e516f353` (the objectstack-ai#33885 head) with a temporary probe in
this harness before any edit: bare effective `zeta fr-FR`, overlay null,
in both orders; `?package=Z` effective `pair fr-FR`.

<details><summary>Ablations (each through
`scripts/ablation-replace.mjs`, metadata-protocol rebuilt,
`ablation-dist-preflight` marker present in 2 dist files, auto-restore
blob equals HEAD with `git diff HEAD` empty, rebuilt, marker absent from
all 24 dist files)</summary>

| | mutation | result (`-t 'the bare layered read serves'`) |
|:--|:--|:--|
| A1 | the arm's call replaced by `undefined` | 3 failed, 3 passed: both
fix pins, `expected [ 'zeta fr-FR', null, …(2) ] to deeply equal [ 'zeta
fr-FR', 'pair fr-FR', …(2) ]`; the draft pin, `expected [ 'zeta fr-FR',
'pair fr-FR draft' ] to deeply equal [ 'pair fr-FR', 'pair fr-FR draft'
]` |
| A2 | `isServedOverrideRowOf(row, shipper, installed)` replaced by
`true` | 2 failed, 4 passed: the undeclared-row CONTROL, `expected [
'zeta fr-FR', 'pair fr-FR', …(2) ] to deeply equal [ 'zeta fr-FR', null,
…(2) ]`; the X-declared CONTROL, `the read answered; a refusal was
expected` |
| A4 | the draft address re-addressed with the arm (`declaredOverrideAt
?? request.packageId`) | 1 failed, 5 passed: the draft pin, `expected [
'pair fr-FR', null ] to deeply equal [ 'pair fr-FR', 'pair fr-FR draft'
]` |

</details>

## Acceptance notes

- The no-row CONTROL pins an unchanged outcome by construction:
re-addressed to Z, Z's exact layers with no row answer Z's own `fr-FR`
too. The undeclared-row CONTROL is the one that catches an arm ignoring
the declaration (A2).
- Still open on objectstack-ai#32849, measured on `e516f353` with the same probe (X
ships `fr-FR`, Z ships `en-US`, the pair row declares Z for `en-US`):
the read naming NO member serves Z's `zeta en-US`, both the plain bare
read and the bare layered read, while the bare layered member read
`?member=en-US` takes the override after this change. `/published` calls
the layered read with no member (`meta-item-history-routes.ts`), so it
reads that same exit; not measured at the door. The helper answers
`undefined` when no member is named; that exit lives in the item face
first and is left to the card.
- Measured through the protocol with a real `SchemaRegistry`, stored
rows and hydrated rows (the objectstack-ai#33815 footing), not through the HTTP save
door; the door's own step 1c is pinned at the protocol.

## Verification

Head `f23319f9` (merges of `origin/claude/area-E1-32622` `e57e7c05` and
of `origin/main` up to `27c2f1ea`, then `origin/main` again just before
opening; the derived gate union ran on `24ecb579`, the head before that
last merge). Every command ran under `scripts/pm/os-verify-lock.sh`.

- Before the last merge, on `96a0a52e`: `@objectstack/metadata-protocol`
typecheck 0, test `22902 passed | 43 skipped`; `@objectstack/objectql`
typecheck 0, test `13252 passed`; `@objectstack/rest` typecheck 0, test
`8763 passed | 355 skipped`; `@objectstack/runtime` typecheck 0, test
`12414 passed | 19 skipped`.
- After the merge, on `24ecb579` (incoming main touched
metadata-protocol, none of rest/runtime): rebuilt, metadata-protocol
typecheck 0, test `22926 passed | 45 skipped`; the harness file `321
passed`.
- `git merge-tree --write-tree --name-only` of `24ecb579` against every
open PR sharing a file, and main: objectstack-ai#33995 (`7b65fff0`, item face and
harness) clean, objectstack-ai#33979 (`999b09d9`, protocol.ts) clean, objectstack-ai#33885
(`e57e7c05`) clean, `origin/main` `27c2f1ea` clean. (Before the first
main merge the harness conflicted with main's objectstack-ai#33817 block; resolved by
keeping both describes.)
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` on `24ecb579`: 75 derived families, every
one exit 0 (exit codes captured before any pipe).
`check:dual-build-cjs-loads` first answered exit 3 PREREQUISITE NOT MET
(no dist for 41 packages) and answered 0 after a whole-tree `pnpm turbo
run build --concurrency=2` under the lock; `check:type-check-debt` was
interrupted mid-run once and re-run to exit 0. `--ran`: 75 derived, 75
run, 0 NOT-MEASURED, 0 UNRUN. Body gates on this body:
`check-changeset-no-major` 0, `check-adr-0087-registration` 0 (with the
PR payload too), `check-closing-keyword-parity` 0 (`GITHUB_EVENT_PATH`),
`check-partof-closing-keyword` 0 (`PR_BODY`).
- `pnpm lint`: exit 0 on `24ecb579`.
- After the last merge of `origin/main` (14 commits; it touched
`protocol-meta-item-reads.ts` and objectql `registry.ts`, not this
diff), on `f23319f9`: closure rebuilt, metadata-protocol typecheck 0 and
test `22926 passed | 45 skipped`, objectql typecheck 0, the harness file
`321 passed`; ratchet families re-run there: `check:type-check-debt` 0,
`check:type-check-coverage` 0, `check:nul-bytes` 0.
- After objectstack-ai#33885 merged: merge of `origin/main` `dfb8ed35` → head
`c9112d29`. The one add/add conflict was objectstack-ai#33885's own changeset,
resolved to main's landed text; none of this PR's files conflicted.
Closure rebuilt, metadata-protocol typecheck 0, objectql typecheck 0,
harness `321 passed`, all under the verify lock.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
<!-- signed: domain:server#5 · zhuangjianguo ·
session_01QsR2jTkZnXtRhuEiiyidvJ -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

metadata-protocol: registry write-through faults for non-object types are only logged, so revertCommit cannot report them

1 participant